﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<div id="login_form">
    <% using (Html.BeginForm("Login", "Account", FormMethod.Post))
       {%>
    <%if (!Request.IsAuthenticated)
      { %>
    <table>
        <tr>
            <th>
                Username
            </th>
            <th>
                Password
            </th>
        </tr>
        <tr>
            <td>
                <%: Html.TextBox("Username", null, new { @class = "username" })%>
            </td>
            <td>
                <%: Html.Password("Password", null, new { @class = "password" })%>
            </td>
            <td>
                <input id="login-btn" type="submit" value="Login" class="button-style"/>
            </td>
        </tr>
        <tr>
            <td>
                <div class="remember">
                    <input type="checkbox" name="rememberme" />
                    <span>Remember me</span>
                </div>
            </td>
            <td>
                <a id="forgot-password-link" href="#"><span>Forgot your password? </span></a>
            </td>
        </tr>
    </table>
    <%}
      else
      {%>
    <div id="search-form">
        <div class="search-text">
            <input type="text" name="q" value="" /></div>
        <div class="search-btn">
            <input type="submit" value="search" class="button-style"/></div>
            <div class="clear"></div>
    </div>
    <div id="welcome-text">
        Welcome <%=Page.User.Identity.Name %>, <%: Html.ActionLink("Logout","Logout",new{Controller="Account",Area=""}) %>
    </div>
    <%} %>
    <% } %>
</div>
